<template>
  <footer class="footer" v-if="list.length">
      <span class="todo-count" v-show="aliveList" ><strong>{{aliveList}}</strong>剩余</span>
      <ul class="filters">
        <li>
          <a :class="{selected:type==='all'}" href="#/" @click="changeRender('all')" >全部</a>
        </li>
        <li>
          <a :class="{selected:type==='active'}" href="#/active" @click="changeRender('active')" >进行中</a>
        </li>
        <li>
          <a :class="{selected:type==='completed'}" @click="changeRender('completed')" href="#/completed">已完成</a>
        </li>
      </ul>
      <button class="clear-completed" @click="removeAllList">清除已完成</button>
  </footer>
</template>

<script>
export default {
  name: 'MyFooter',
  props: {
    aliveList:{
      type:Number,
      required:true
    },
    type:{
      type:String
    },
    list:{
      type:Array
    }
  },
  methods:{
removeAllList(){
  this.$emit('removeAllList')
},
changeRender(type){
  this.$emit('changeRender',type)
}
  },
  components: {},

}
</script>

<style scoped lang="less"></style>